package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HospitalSubscribeBannerMapper;
import com.ruoyi.system.domain.HospitalSubscribeBanner;
import com.ruoyi.system.service.IHospitalSubscribeBannerService;

/**
 * 轮播图Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-30
 */
@Service
public class HospitalSubscribeBannerServiceImpl implements IHospitalSubscribeBannerService 
{
    @Autowired
    private HospitalSubscribeBannerMapper hospitalSubscribeBannerMapper;

    /**
     * 查询轮播图
     * 
     * @param id 轮播图主键
     * @return 轮播图
     */
    @Override
    public HospitalSubscribeBanner selectHospitalSubscribeBannerById(Long id)
    {
        return hospitalSubscribeBannerMapper.selectHospitalSubscribeBannerById(id);
    }

    /**
     * 查询轮播图列表
     * 
     * @param hospitalSubscribeBanner 轮播图
     * @return 轮播图
     */
    @Override
    public List<HospitalSubscribeBanner> selectHospitalSubscribeBannerList(HospitalSubscribeBanner hospitalSubscribeBanner)
    {
        return hospitalSubscribeBannerMapper.selectHospitalSubscribeBannerList(hospitalSubscribeBanner);
    }

    /**
     * 新增轮播图
     * 
     * @param hospitalSubscribeBanner 轮播图
     * @return 结果
     */
    @Override
    public int insertHospitalSubscribeBanner(HospitalSubscribeBanner hospitalSubscribeBanner)
    {
        hospitalSubscribeBanner.setCreateTime(DateUtils.getNowDate());
        return hospitalSubscribeBannerMapper.insertHospitalSubscribeBanner(hospitalSubscribeBanner);
    }

    /**
     * 修改轮播图
     * 
     * @param hospitalSubscribeBanner 轮播图
     * @return 结果
     */
    @Override
    public int updateHospitalSubscribeBanner(HospitalSubscribeBanner hospitalSubscribeBanner)
    {
        hospitalSubscribeBanner.setUpdateTime(DateUtils.getNowDate());
        return hospitalSubscribeBannerMapper.updateHospitalSubscribeBanner(hospitalSubscribeBanner);
    }

    /**
     * 批量删除轮播图
     * 
     * @param ids 需要删除的轮播图主键
     * @return 结果
     */
    @Override
    public int deleteHospitalSubscribeBannerByIds(Long[] ids)
    {
        return hospitalSubscribeBannerMapper.deleteHospitalSubscribeBannerByIds(ids);
    }

    /**
     * 删除轮播图信息
     * 
     * @param id 轮播图主键
     * @return 结果
     */
    @Override
    public int deleteHospitalSubscribeBannerById(Long id)
    {
        return hospitalSubscribeBannerMapper.deleteHospitalSubscribeBannerById(id);
    }
}
